import api from "@/util/api.js";
//查询
async function getall(){
    let resp=await api({
        url:"/category/tree",
        method:"get",   
    })
    return resp;
}
//删除
async function deleteid(id){
    let resp=await api({
        url:"/category/delete",
        method:"get",
        params:{id}
    })
    return resp;
}
//新增
async function addall(category){
    let resp=await api({
        url:"/category",
        method:"post",
        data:category
    })
    return resp;
}
//修改
async function updateal(category){
    let resp=await api({
        url:"/category",
        method:"put",
        data:category
    })
    return resp;
}
//条件查询
async function get(name,description){
    let resp=await api({
        url:"/category/tiaojian",
        method:"get",
        params:{name,description}
    })

    return resp;
}
//查询
async function getname(id){
    let resp=await api({
        url:"/category/name",
        method:"get",  
        params:{id} 
    })
    return resp;
}


//导出
export{getall,deleteid,addall,updateal,get,getname}